package config

import (
	"github.com/spf13/viper"
	"log"
)

type Mysql struct {
	User     string
	Password string
	Host     string
	Port     int
	Database string
}
type Redis struct {
	Password string
	Host     string
	Port     int
}
type ConfigData struct {
	Mysql
	Redis
}

var GetConfigData ConfigData

func Init() {
	viper.SetConfigFile("config/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&GetConfigData)
	log.Println(GetConfigData)
}
